{ lib, pkgs, ... }:
{
  imports = [ ./hardware-configuration.nix ];

  boot.loader = {
    systemd-boot = {
      enable = true;
      editor = false;
      configurationLimit = 16;
    };
    efi.canTouchEfiVariables = true;
  };
  networking = {
    hostName = "laptain";
    networkmanager.enable = true;
  };
  hardware.bluetooth.enable = true;

  users = {
    mutableUsers = false;
    users."rczb" = {
      description = "rczb";
      hashedPassword = lib.trivial.importJSON ./private/hashed-password.json;
      isNormalUser = true;
      extraGroups = [
        "wheel"
        "networkmanager"
      ];
    };
  };

  services = {
    logind = {
      powerKey = "ignore";
      lidSwitch = "ignore";
    };
    clamav = {
      daemon.enable = true;
      updater.enable = true;
      fangfrisch = {
        enable = true;
        settings."sanesecurity"."enabled" = "no";
      };
      scanner.enable = true;
    };
    openssh.enable = true;
    tzupdate.enable = true;
    pipewire = {
      enable = true;
      alsa.enable = true;
      pulse.enable = true;
    };
  };
  programs = {
    command-not-found.enable = false;
    git = {
      enable = true;
      lfs.enable = true;
    };
    nano.enable = false;
    vim = {
      enable = true;
      defaultEditor = true;
    };
  };
  environment.systemPackages = with pkgs; [
    aria2
  ];

  nix = {
    settings = {
      fallback = true;
      pure-eval = true;
      use-xdg-base-directories = true;
      experimental-features = [
        "nix-command"
        "flakes"
      ];
      channel.enable = false;
      gc = {
        automatic = true;
        dates = "monthly";
      };
      substituters = [
        "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
        "https://mirrors.ustc.edu.cn/nix-channels/store"
        "https://mirror.nju.edu.cn/nix-channels/store"
        "https://mirrors.sustech.edu.cn/nix-channels/store"
        "https://mirrors.sjtug.sjtu.edu.cn/nix-channels/store"
        "https://mirrors.cernet.edu.cn/nix-channels/store"
      ];
      trusted-substituters = [
        "https://mirror.iscas.ac.cn/nix-channels/store"
        "https://mirror.nyist.edu.cn/nix-channels/store"
        "https://mirrors.cqupt.edu.cn/nix-channels/store"
      ];
    };
  };

  system.stateVersion = "24.05";
}
